import request from "@/utils/request"

export async function queryEmployeeList(params: Employee.QueryEmployeeListParams) {
  return request<Employee.Entity[]>('/app/manager/user/list', {
    data: params,
  })
}

export async function editEmployee(params: Employee.Entity) {
  return request('/app/manager/user/addOrUp', {
    data: params,
  })
}

export async function getEmployeeInfo(params: {userId: number}) {
  return request<Employee.Entity>('/app/manager/user/detail', {
    data: params,
  })
}

export async function delEmployee(params: {
  id: number, 
  status: 1 | 2 | 3, // 1:启用，2-禁用，3-删除
}) {
  return request('/app/manager/user/del', {
    data: params,
  })
}

export async function passRest(params: {id: number}) {
  return request('/app/manager/user/passRest', {
    data: params,
  })
}

export async function getOperateLog(params: Employee.QueryOperateLogParams) {
  return request<Employee.OperateLog[]>('/app/manager/log/list', {
    data: params,
  })
}
